package com.android.launcher3;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;

class FastBitmapDrawable extends Drawable {
	private Bitmap mBitmap;
	private Paint mPaint;

	/**
	 * Creates a new FastBitmapDrawable object.
	 */
	FastBitmapDrawable(final Bitmap bm) {
		this.mPaint = new Paint();
		this.mBitmap = bm;
	}

	public void draw(final Canvas canvas) {
		canvas.drawBitmap(this.mBitmap, 0.0F, 0.0F, this.mPaint);
	}

	public Bitmap getBitmap() {
		return this.mBitmap;
	}

	public int getIntrinsicHeight() {
		return this.mBitmap.getHeight();
	}

	public int getIntrinsicWidth() {
		return this.mBitmap.getWidth();
	}

	public int getMinimumHeight() {
		return this.mBitmap.getHeight();
	}

	public int getMinimumWidth() {
		return this.mBitmap.getWidth();
	}

	public int getOpacity() {
		return -1;
	}

	public void setAlpha(final int alpha) {
	}

	public void setColorFilter(final ColorFilter colorFilter) {
		this.mPaint.setColorFilter(colorFilter);
	}
}
